﻿Imports System.CodeDom
Public Class MemberAttributeObject

    'Abstract An abstract member.  
    Private _Abstract As Boolean
    Public Property [Abstract]() As Boolean
        Get
            Return _Abstract
        End Get
        Set(ByVal value As Boolean)
            _Abstract = value
        End Set
    End Property

    ''Final A member that cannot be overridden in a derived class.  
    'Private _Final As Boolean
    'Public Property [Final]() As Boolean
    '    Get
    '        Return _Final
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _Final = value
    '    End Set
    'End Property

    'Static A static member. In Visual Basic, this is equivalent to the Shared keyword.  
    Private _Static As Boolean
    Public Property [StaticShared]() As Boolean
        Get
            Return _Static
        End Get
        Set(ByVal value As Boolean)
            _Static = value
        End Set
    End Property

    ''Override A member that overrides a base class member.  
    'Private _Override As Boolean
    'Public Property [Override]() As Boolean
    '    Get
    '        Return _Override
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _Override = value
    '    End Set
    'End Property

    ''Const A constant member.  
    'Private _Const As Boolean
    'Public Property [Const]() As Boolean
    '    Get
    '        Return _Const
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _Const = value
    '    End Set
    'End Property

    ''New A new member.  
    'Private _New As Boolean
    'Public Property [New]() As Boolean
    '    Get
    '        Return _New
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _New = value
    '    End Set
    'End Property

    ''Overloaded An overloaded member. Some languages, such as Visual Basic, require overloaded members to be explicitly indicated.  
    'Private _Overloaded As Boolean
    'Public Property [Overloaded]() As Boolean
    '    Get
    '        Return _Overloaded
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _Overloaded = value
    '    End Set
    'End Property

    ''Assembly A member that is accessible to any class within the same assembly.  
    'Private _Assembly As Boolean
    'Public Property [Assembly]() As Boolean
    '    Get
    '        Return _Assembly
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _Assembly = value
    '    End Set
    'End Property

    ''FamilyAndAssembly A member that is accessible within its class, and derived classes in the same assembly.  
    'Private _FamilyAndAssembly As Boolean
    'Public Property [FamilyAndAssembly]() As Boolean
    '    Get
    '        Return _FamilyAndAssembly
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _FamilyAndAssembly = value
    '    End Set
    'End Property

    ''Family A member that is accessible within the family of its class and derived classes.  
    'Private _Family As Boolean
    'Public Property [Family]() As Boolean
    '    Get
    '        Return _Family
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _Family = value
    '    End Set
    'End Property

    ''FamilyOrAssembly A member that is accessible within its class, its derived classes in any assembly, and any class in the same assembly.  
    'Private _FamilyOrAssembly As Boolean
    'Public Property [FamilyOrAssembly]() As Boolean
    '    Get
    '        Return _FamilyOrAssembly
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _FamilyOrAssembly = value
    '    End Set
    'End Property

    ''Private A private member.  
    'Private _Private As Boolean
    'Public Property [Private]() As Boolean
    '    Get
    '        Return _Private
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _Private = value
    '    End Set
    'End Property

    'Public A public member.  
    Private _Public As Boolean
    Public Property [Public]() As Boolean
        Get
            Return _Public
        End Get
        Set(ByVal value As Boolean)
            _Public = value
        End Set
    End Property

    ''AccessMask An access mask.  
    'Private _AccessMask As Boolean
    'Public Property [AccessMask]() As Boolean
    '    Get
    '        Return _AccessMask
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _AccessMask = value
    '    End Set
    'End Property

    ''ScopeMask A scope mask.  
    'Private _ScopeMask As Boolean
    'Public Property [ScopeMask]() As Boolean
    '    Get
    '        Return _ScopeMask
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _ScopeMask = value
    '    End Set
    'End Property

    ''VTableMask A VTable mask.  

    'Private _VTableMask As Boolean
    'Public Property [VTableMask]() As Boolean
    '    Get
    '        Return _VTableMask
    '    End Get
    '    Set(ByVal value As Boolean)
    '        _VTableMask = value
    '    End Set
    'End Property

    Public Function GetMemberAttributes() As MemberAttributes
        Dim myMemberAttributes As MemberAttributes = 0

        If [Abstract] Then myMemberAttributes += MemberAttributes.Abstract
        'If [Final] Then myMemberAttributes += MemberAttributes.Final
        If [StaticShared] Then myMemberAttributes += MemberAttributes.Static
        'If [Override] Then myMemberAttributes += MemberAttributes.Override
        'If [Const] Then myMemberAttributes += MemberAttributes.Const
        'If [New] Then myMemberAttributes += MemberAttributes.New
        'If [Overloaded] Then myMemberAttributes += MemberAttributes.Overloaded
        'If [Assembly] Then myMemberAttributes += MemberAttributes.Assembly
        'If [FamilyAndAssembly] Then myMemberAttributes += MemberAttributes.FamilyAndAssembly
        'If [Family] Then myMemberAttributes += MemberAttributes.Family
        'If [FamilyOrAssembly] Then myMemberAttributes += MemberAttributes.FamilyOrAssembly
        'If [Private] Then myMemberAttributes += MemberAttributes.Private
        If [Public] Then myMemberAttributes += MemberAttributes.Public
        'If [AccessMask] Then myMemberAttributes += MemberAttributes.AccessMask
        'If [ScopeMask] Then myMemberAttributes += MemberAttributes.ScopeMask
        'If [VTableMask] Then myMemberAttributes += MemberAttributes.VTableMask

        If myMemberAttributes = 0 Then myMemberAttributes = MemberAttributes.Public
        Return myMemberAttributes

    End Function
End Class
